<template>


	<view>

		<view class="uni-flex uni-row" v-for="item in messageList">
			<view class="flex-left ">
				<view class="uni-flex uni-row" style="margin-top: 10px;">
					<image class="image" src="/static/message.png" width="40" />
				</view>
			</view>
			<view class="flex-right ">
				<uni-group mode="card">
					<view class="font-color">{{item.describe}}</view>
				</uni-group>
				<view style="justify-content: flex-start;margin: 10px;display: flex;line-height: 10px;"
					class="font-color">
					{{ new Date(item.createtime).format() }}
				</view>
			</view>
		</view>



	</view>


</template>

<script>
	export default {
		data() {
			return {
				messageList: [],
				userEntity: this.StorageCache('user')
			}
		},
		onLoad() {
			this.Init()
		},
		methods: {
			Init() {

				this.checkLogin()


				this.MessageInit()
			},
			MessageInit() {
				this.messageList = []

				uni.request({
					url: this.url+'AppGetMessage',
					header: {
						'content-type': 'application/x-www-form-urlencoded',
					},
					method: 'POST',
					dataType: 'json',
					data: {
						type: 0,
						index: 1,
						size: 10,
						userId: this.userEntity.sid
					},
					success: (res) => {

						if (res.statusCode == 200) {
							for (let i = 0; i < res.data.length; i++) {
								this.messageList.push(res.data[i])

							}
						}
					},
					complete: (res) => {
				
					}
				});

			}


		}

	}
</script>

<style>
	.flex-left {
		width: 15%;
		/* height: 200rpx; */
		text-align: center;
		line-height: 200rpx;
		margin-left: 20px;
	}

	.flex-right {
		width: 80%;

	}

	.image {
		width: 38px;
		height: 38px;
	}

	.font-color {
		color: #8e8383;
	}
	/deep/ .uni-group__content {
		padding: 5px
	}
</style>
